#include <stdio.h>
#include <stdlib.h>

/************************************************************************/
/*                                                                      */
/************************************************************************/
int sequential_search(int *buf, int len, int key)
{
    int i;
    
    for(i = 0; i < len; i++)
    {
        if (buf[i] == key)
            return i;
    }
    
    return -1;
}

/************************************************************************/
/*                                                                      */
/************************************************************************/

int main(int argc, char* argv[])
{
    int a[] = {1,2,3,4,5,6,7,8,9,12,13,45,67,89,99,101,111,123,134,565,677};
    int b[] = {677, 1, 7, 11, 67, 99, 1, 680};

    int i;
    
    for(i = 0; i<sizeof(b)/sizeof(b[0]); i++ )
    {
        printf("%d\n", sequential_search(a, sizeof(a)/sizeof(a[0]), b[i]));
    }
    
    return 0;
}